using System;
using System.Collections;
using System.Data;
using Sedna.Core.Controls.Actions.Support;

namespace Sedna.Core.Controls.Actions
{
	/// <summary>
	/// Summary description for LoadWarehouseDataAction.
	/// </summary>
	public class LoadWhsReceiptTypeDataAction : BaseFilterAction
	{

//		private IWhsReceiptTypeApi configurationApi;

		public LoadWhsReceiptTypeDataAction()
		{
		}

//		public IWhsReceiptTypeApi ConfigurationApi
//		{
//			get { return configurationApi; }
//			set { configurationApi = value; }
//		}



		protected override ICollection GetResultSet(object filter)
		{
			DataTable dt = new DataTable();
			DataColumn dcId = new DataColumn("ID", typeof(int));
			DataColumn dcCode = new DataColumn("CODE", typeof(string));
			DataColumn dcName = new DataColumn("NAME", typeof(string));
			DataColumn dcExchange = new DataColumn("EXCHANGE", typeof(string));
			DataColumn dcMinWeight = new DataColumn("MIN_WEIGHT", typeof(decimal));
			DataColumn dcMaxWeight = new DataColumn("MAX_WEIGHT", typeof(decimal));
			dt.Columns.AddRange(new DataColumn[] {dcId, dcCode, dcName, dcMaxWeight, dcMinWeight, dcExchange});
			for (int i = 0; i <= 5; i++)
			{
				DataRow dr = dt.NewRow();
				dr["ID"] = i;
				dr["CODE"] = "WhsReceiptType 0" + i;
				dr["NAME"] = "WhsReceiptType 0" + i;
				dr["EXCHANGE"] = "COMEX";
				dr["MIN_WEIGHT"] = 0.999M;
				dr["MAX_WEIGHT"] = 2.000M;
				
				dt.Rows.Add(dr);
			}
			dt.AcceptChanges();
			
			return dt.DefaultView;
		}



	}
}
